1. Field of the Invention
The present invention relates to a technique for correcting contrast of images.
2. Description of the Background Art
Conventionally, a contrast correcting operation for emphasizing contrast of images picked up by a digital camera or a scanner has been carried out. Here, in general, the contrast refers to a difference in gray levels between a background part and a main subject part in an image or a difference between the maximum gray level and the minimum gray level in an image; in this case, however, it is assumed that the contrast simply refers to the degree of differences between bright portions and dark portions distributed in an image. Therefore, in the following description, the correction of the contrast substantially corresponds to a process for correcting a gray level histogram of an image for transforming the gray levels in pixels.
For one example of contrast corrections, a method has been proposed, in which a gray level histogram is generated in a predetermined region around a pixel of interest that is to be corrected, and after the gray level histogram has been transformed, an accumulated histogram is generated, and the resulting accumulated histogram is utilized as a gray level transformation curve so as to transform the gray level of the pixel of interest.
However, in this method (hereinafter, referred to as “correction method with local histograms”), it is necessary to generate gray level histograms for respective pixels, and the resulting problem is that a great amount of calculations have to be made.
As to a modified method for the correction method with local histograms, another method has been proposed, in which an image is divided into a plurality of rectangular regions, and a gray level histogram is formed for each region, and this gray level histogram is transformed to an accumulated histogram, and by utilizing this as a gray level transformation curve, the gray levels of all the pixels within each region are transformed. With this method, the gray level transformation curves as many as the number of the divided regions are generated to correct the contrast, thereby making it possible to shorten the calculation time.
However, in the conventional contrast correction method which divides an image into a plurality of regions, and carries out a contrast correcting process on the basis of each region, the size of the region is fixed. As a result, in the case when gray level transformation curves are greatly different between the regions, the gray levels are greatly different on both of the sides of the border between the corresponding regions. Here, it is of course possible to alleviate the difference in gray levels between the regions by using linear interpolation, etc. however, in the case when gray levels are greatly different on both of the sides of the border, unevenness in gray levels become conspicuous even in an image after the correction.